package com.time.sky.controller;

import com.time.sky.entity.DCJF;
import com.time.sky.mapper.CDJFMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/DCJF")
public class DCJFController {
    @Autowired
    private CDJFMapper cdjfMapper;
    @ResponseBody
    @RequestMapping("/select")
    public List<DCJF> selectList(){   return cdjfMapper.selectList(); }
    @RequestMapping("/add")
    public void add(DCJF dcjf){
        cdjfMapper.add(dcjf);
    }
    @RequestMapping("/delete/{did}")
    public void delete(@PathVariable("did") int did){
        cdjfMapper.delete(did);
    }
    @RequestMapping("/get/{did}")
    public DCJF getById(@PathVariable("did") int did){
        return cdjfMapper.getById(did);
    }
    @RequestMapping("/update")
    public void update(DCJF dcjf){
        cdjfMapper.update(dcjf);
    }
}
